{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 1]\n",
      " [0 1]]\n",
      "[[0 1]\n",
      " [2 3]]\n",
      "************************\n",
      "[[0 1]\n",
      " [0 3]]\n",
      "************************\n",
      "[[2 4]\n",
      " [2 3]]\n",
      "************************\n",
      "[[2 4]\n",
      " [2 3]]\n"
     ]
    }
   ],
   "source": [
    "a = np.array([\n",
    "    [1,1],\n",
    "    [0,1]\n",
    "])\n",
    "b = np.arange(4).reshape(2,2)\n",
    "print(a)\n",
    "print(b)\n",
    "print('************************')\n",
    "# 对应元素相乘\n",
    "c = a * b\n",
    "# 矩阵相乘\n",
    "c_dot = np.dot(a, b)\n",
    "c_dot_2 = a.dot(b)\n",
    "print(c)\n",
    "print('************************')\n",
    "print(c_dot)\n",
    "print('************************')\n",
    "print(c_dot_2)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
